<?php
/**
  * 系統名稱: Lotto 系統
  * 檔案說明: 專案管理-修改
  * $Author$
  * $Id$
  *
  */
$intLID = (int)$_data["ID"];
$arrBParam = $_data["arrBetParam"];

$strSQL = "select * from `bet_Lotto` where ID = ".$intLID;
if(!$RS = @PMA_mysql_query($strSQL, $$_Conn)){
	$GLOBALS["errormessage"] = "Find Lotto Data Error!!";
	ErrMsgOutputHTML("Error", "", 1);
}

if(PMA_mysql_num_rows($RS) == 0){
	@mysql_close($$_Conn);
	header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List");
	exit();
}else{
	$objLotto = PMA_mysql_fetch_object($RS);
}
$intLType = $objLotto -> LType;

$arrBP = GetArrayBetParam($intLID, $intLType);
if($arrBP === false)ErrMsgOutputHTML("Error", "", 1);

if(sizeof($arrBP) != sizeof($arrBParam)){
	$GLOBALS["errormessage"] = "Param Data Error!!";
	$GLOBALS["errorhidden"] = "Array: ".print_r($_POST, true).print_r($arrBParam, true)."\nLine:".__LINE__."\nPage:".__FILE__;
	$strPost = print_r($_POST, true)."\n".print_r($arrBParam, true);
	$strPost = addslashes($strPost);
	AddData_Log("", "Lotto 下注參數遺漏", $strPost);
	ErrMsgOutputHTML("Error", "", 1);
}

//更改 Lotto 下注參數
if(!UpdateArrayBetParam($intLID, $arrBParam))ErrMsgOutputHTML("Error", "", 1);
//產生 Lotto 下注參數檔案
if(!MakeBetParamFile($intLID, $arrBParam))ErrMsgOutputHTML("Error", "", 1);
@mysql_close($$_Conn);
header("Location: ".basename($_SERVER["PHP_SELF"])."?op=List&Page=".(string)intval($_data["Page"]));
?>